home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / A Professi26000962001.psc / Form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-09-05  |  48.5 KB  |  1,371 lines

  1. VERSION 5.00
  2. Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
  3. Begin VB.Form Form1 
  4.    BackColor       =   &H00C0C0C0&
  5.    BorderStyle     =   1  'Fixed Single
  6.    Caption         =   "Hex Editor Pro"
  7.    ClientHeight    =   7470
  8.    ClientLeft      =   45
  9.    ClientTop       =   615
  10.    ClientWidth     =   9630
  11.    BeginProperty Font 
  12.       Name            =   "Rockwell"
  13.       Size            =   8.25
  14.       Charset         =   0
  15.       Weight          =   400
  16.       Underline       =   0   'False
  17.       Italic          =   0   'False
  18.       Strikethrough   =   0   'False
  19.    EndProperty
  20.    Icon            =   "Form1.frx":0000
  21.    LinkTopic       =   "Form1"
  22.    MaxButton       =   0   'False
  23.    MinButton       =   0   'False
  24.    ScaleHeight     =   7470
  25.    ScaleWidth      =   9630
  26.    StartUpPosition =   2  'CenterScreen
  27.    Begin MSComctlLib.ImageList ImageList1 
  28.       Left            =   4560
  29.       Top             =   2280
  30.       _ExtentX        =   1005
  31.       _ExtentY        =   1005
  32.       BackColor       =   -2147483643
  33.       ImageWidth      =   16
  34.       ImageHeight     =   15
  35.       MaskColor       =   12632256
  36.       _Version        =   393216
  37.       BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628} 
  38.          NumListImages   =   11
  39.          BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  40.             Picture         =   "Form1.frx":08CA
  41.             Key             =   ""
  42.          EndProperty
  43.          BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  44.             Picture         =   "Form1.frx":0E0E
  45.             Key             =   ""
  46.          EndProperty
  47.          BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  48.             Picture         =   "Form1.frx":1262
  49.             Key             =   ""
  50.          EndProperty
  51.          BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  52.             Picture         =   "Form1.frx":16B6
  53.             Key             =   ""
  54.          EndProperty
  55.          BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  56.             Picture         =   "Form1.frx":1B0A
  57.             Key             =   ""
  58.          EndProperty
  59.          BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  60.             Picture         =   "Form1.frx":1F5E
  61.             Key             =   ""
  62.          EndProperty
  63.          BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  64.             Picture         =   "Form1.frx":24A2
  65.             Key             =   ""
  66.          EndProperty
  67.          BeginProperty ListImage8 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  68.             Picture         =   "Form1.frx":29E6
  69.             Key             =   ""
  70.          EndProperty
  71.          BeginProperty ListImage9 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  72.             Picture         =   "Form1.frx":2AFA
  73.             Key             =   ""
  74.          EndProperty
  75.          BeginProperty ListImage10 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  76.             Picture         =   "Form1.frx":2C12
  77.             Key             =   ""
  78.          EndProperty
  79.          BeginProperty ListImage11 {2C247F27-8591-11D1-B16A-00C0F0283628} 
  80.             Picture         =   "Form1.frx":3156
  81.             Key             =   ""
  82.          EndProperty
  83.       EndProperty
  84.    End
  85.    Begin MSComctlLib.Toolbar Toolbar1 
  86.       Align           =   1  'Align Top
  87.       Height          =   345
  88.       Left            =   0
  89.       TabIndex        =   12
  90.       Top             =   0
  91.       Width           =   9630
  92.       _ExtentX        =   16986
  93.       _ExtentY        =   609
  94.       ButtonWidth     =   609
  95.       ButtonHeight    =   556
  96.       Appearance      =   1
  97.       Style           =   1
  98.       ImageList       =   "ImageList1"
  99.       _Version        =   393216
  100.       BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628} 
  101.          NumButtons      =   12
  102.          BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  103.             Key             =   "open"
  104.             Object.ToolTipText     =   "Open"
  105.             ImageIndex      =   1
  106.          EndProperty
  107.          BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  108.             Key             =   "save"
  109.             Object.ToolTipText     =   "Save"
  110.             ImageIndex      =   6
  111.          EndProperty
  112.          BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  113.             Key             =   "close"
  114.             Object.ToolTipText     =   "Close"
  115.             ImageIndex      =   9
  116.          EndProperty
  117.          BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  118.             Key             =   "sep1"
  119.             Style           =   3
  120.          EndProperty
  121.          BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  122.             Key             =   "Edit"
  123.             Object.ToolTipText     =   "Edit Mode"
  124.             ImageIndex      =   2
  125.          EndProperty
  126.          BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  127.             Key             =   "sep2"
  128.             Style           =   3
  129.          EndProperty
  130.          BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  131.             Key             =   "Add"
  132.             Object.ToolTipText     =   "Add Bytes"
  133.             ImageIndex      =   4
  134.          EndProperty
  135.          BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  136.             Key             =   "Remove"
  137.             Object.ToolTipText     =   "Remove Byte"
  138.             ImageIndex      =   5
  139.          EndProperty
  140.          BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  141.             Key             =   "Insert"
  142.             Object.ToolTipText     =   "Insert Byte"
  143.             ImageIndex      =   7
  144.          EndProperty
  145.          BeginProperty Button10 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  146.             Key             =   "sep3"
  147.             Style           =   3
  148.          EndProperty
  149.          BeginProperty Button11 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  150.             Key             =   "search"
  151.             Object.ToolTipText     =   "Search"
  152.             ImageIndex      =   8
  153.          EndProperty
  154.          BeginProperty Button12 {66833FEA-8583-11D1-B16A-00C0F0283628} 
  155.             Key             =   "goto"
  156.             Object.ToolTipText     =   "Goto Byte"
  157.             ImageIndex      =   11
  158.          EndProperty
  159.       EndProperty
  160.    End
  161.    Begin VB.Frame frame 
  162.       BackColor       =   &H8000000B&
  163.       BeginProperty Font 
  164.          Name            =   "MS Sans Serif"
  165.          Size            =   8.25
  166.          Charset         =   0
  167.          Weight          =   400
  168.          Underline       =   0   'False
  169.          Italic          =   0   'False
  170.          Strikethrough   =   0   'False
  171.       EndProperty
  172.       Height          =   7095
  173.       Left            =   0
  174.       TabIndex        =   0
  175.       Top             =   360
  176.       Width           =   9615
  177.       Begin VB.Frame Frame1 
  178.          Caption         =   "Converstions"
  179.          BeginProperty Font 
  180.             Name            =   "Times New Roman"
  181.             Size            =   9.75
  182.             Charset         =   0
  183.             Weight          =   700
  184.             Underline       =   0   'False
  185.             Italic          =   0   'False
  186.             Strikethrough   =   0   'False
  187.          EndProperty
  188.          Height          =   3135
  189.          Left            =   7440
  190.          TabIndex        =   20
  191.          Top             =   3840
  192.          Width           =   2055
  193.          Begin VB.TextBox asciidisp 
  194.             BeginProperty Font 
  195.                Name            =   "Times New Roman"
  196.                Size            =   9.75
  197.                Charset         =   0
  198.                Weight          =   400
  199.                Underline       =   0   'False
  200.                Italic          =   0   'False
  201.                Strikethrough   =   0   'False
  202.             EndProperty
  203.             Height          =   375
  204.             Left            =   840
  205.             MaxLength       =   3
  206.             TabIndex        =   24
  207.             Top             =   1920
  208.             Width           =   615
  209.          End
  210.          Begin VB.TextBox hexdisp 
  211.             BeginProperty Font 
  212.                Name            =   "Times New Roman"
  213.                Size            =   9.75
  214.                Charset         =   0
  215.                Weight          =   400
  216.                Underline       =   0   'False
  217.                Italic          =   0   'False
  218.                Strikethrough   =   0   'False
  219.             EndProperty
  220.             Height          =   375
  221.             Left            =   840
  222.             MaxLength       =   2
  223.             TabIndex        =   23
  224.             Top             =   1200
  225.             Width           =   615
  226.          End
  227.          Begin VB.TextBox chardisp 
  228.             BeginProperty Font 
  229.                Name            =   "Times New Roman"
  230.                Size            =   9.75
  231.                Charset         =   0
  232.                Weight          =   400
  233.                Underline       =   0   'False
  234.                Italic          =   0   'False
  235.                Strikethrough   =   0   'False
  236.             EndProperty
  237.             Height          =   375
  238.             Left            =   840
  239.             MaxLength       =   1
  240.             TabIndex        =   22
  241.             Top             =   480
  242.             Width           =   615
  243.          End
  244.          Begin VB.TextBox binarytxt 
  245.             BeginProperty Font 
  246.                Name            =   "Times New Roman"
  247.                Size            =   12
  248.                Charset         =   0
  249.                Weight          =   400
  250.                Underline       =   0   'False
  251.                Italic          =   0   'False
  252.                Strikethrough   =   0   'False
  253.             EndProperty
  254.             Height          =   375
  255.             Left            =   840
  256.             MaxLength       =   8
  257.             TabIndex        =   21
  258.             Top             =   2640
  259.             Width           =   1095
  260.          End
  261.          Begin VB.Label Label3 
  262.             Caption         =   "Hex:"
  263.             BeginProperty Font 
  264.                Name            =   "Times New Roman"
  265.                Size            =   12
  266.                Charset         =   0
  267.                Weight          =   400
  268.                Underline       =   0   'False
  269.                Italic          =   0   'False
  270.                Strikethrough   =   0   'False
  271.             EndProperty
  272.             Height          =   375
  273.             Left            =   120
  274.             TabIndex        =   28
  275.             Top             =   1200
  276.             Width           =   615
  277.          End
  278.          Begin VB.Label Label2 
  279.             Caption         =   "Ascii:"
  280.             BeginProperty Font 
  281.                Name            =   "Times New Roman"
  282.                Size            =   12
  283.                Charset         =   0
  284.                Weight          =   400
  285.                Underline       =   0   'False
  286.                Italic          =   0   'False
  287.                Strikethrough   =   0   'False
  288.             EndProperty
  289.             Height          =   375
  290.             Left            =   120
  291.             TabIndex        =   27
  292.             Top             =   1920
  293.             Width           =   615
  294.          End
  295.          Begin VB.Label Label1 
  296.             Caption         =   "Char:"
  297.             BeginProperty Font 
  298.                Name            =   "Times New Roman"
  299.                Size            =   12
  300.                Charset         =   0
  301.                Weight          =   400
  302.                Underline       =   0   'False
  303.                Italic          =   0   'False
  304.                Strikethrough   =   0   'False
  305.             EndProperty
  306.             Height          =   375
  307.             Left            =   120
  308.             TabIndex        =   26
  309.             Top             =   480
  310.             Width           =   615
  311.          End
  312.          Begin VB.Label Label4 
  313.             Caption         =   "Binary:"
  314.             BeginProperty Font 
  315.                Name            =   "Times New Roman"
  316.                Size            =   12
  317.                Charset         =   0
  318.                Weight          =   400
  319.                Underline       =   0   'False
  320.                Italic          =   0   'False
  321.                Strikethrough   =   0   'False
  322.             EndProperty
  323.             Height          =   375
  324.             Left            =   120
  325.             TabIndex        =   25
  326.             Top             =   2640
  327.             Width           =   735
  328.          End
  329.       End
  330.       Begin VB.Frame Frame2 
  331.          Height          =   3135
  332.          Left            =   120
  333.          TabIndex        =   15
  334.          Top             =   3840
  335.          Width           =   1815
  336.          Begin VB.CommandButton cmdremove 
  337.             Caption         =   "Remove Byte"
  338.             BeginProperty Font 
  339.                Name            =   "Times New Roman"
  340.                Size            =   9.75
  341.                Charset         =   0
  342.                Weight          =   700
  343.                Underline       =   0   'False
  344.                Italic          =   0   'False
  345.                Strikethrough   =   0   'False
  346.             EndProperty
  347.             Height          =   855
  348.             Left            =   120
  349.             TabIndex        =   18
  350.             ToolTipText     =   "Remove Byte"
  351.             Top             =   1200
  352.             Width           =   1575
  353.          End
  354.          Begin VB.CommandButton CmdInsert 
  355.             Caption         =   "Insert Byte"
  356.             BeginProperty Font 
  357.                Name            =   "Times New Roman"
  358.                Size            =   9.75
  359.                Charset         =   0
  360.                Weight          =   700
  361.                Underline       =   0   'False
  362.                Italic          =   0   'False
  363.                Strikethrough   =   0   'False
  364.             EndProperty
  365.             Height          =   855
  366.             Left            =   120
  367.             TabIndex        =   17
  368.             ToolTipText     =   "Insert Byte"
  369.             Top             =   240
  370.             Width           =   1575
  371.          End
  372.          Begin VB.CommandButton AddBytes 
  373.             Caption         =   "Add Bytes"
  374.             BeginProperty Font 
  375.                Name            =   "Times New Roman"
  376.                Size            =   9.75
  377.                Charset         =   0
  378.                Weight          =   700
  379.                Underline       =   0   'False
  380.                Italic          =   0   'False
  381.                Strikethrough   =   0   'False
  382.             EndProperty
  383.             Height          =   855
  384.             Left            =   120
  385.             TabIndex        =   16
  386.             ToolTipText     =   "Add Bytes"
  387.             Top             =   2160
  388.             Width           =   1575
  389.          End
  390.       End
  391.       Begin VB.PictureBox DispTxt 
  392.          AutoRedraw      =   -1  'True
  393.          BackColor       =   &H80000009&
  394.          BeginProperty Font 
  395.             Name            =   "Courier"
  396.             Size            =   15
  397.             Charset         =   0
  398.             Weight          =   400
  399.             Underline       =   0   'False
  400.             Italic          =   0   'False
  401.             Strikethrough   =   0   'False
  402.          EndProperty
  403.          Height          =   3135
  404.          Left            =   2040
  405.          ScaleHeight     =   3075
  406.          ScaleWidth      =   5235
  407.          TabIndex        =   14
  408.          Top             =   3840
  409.          Width           =   5295
  410.          Begin VB.TextBox Showtxt 
  411.             Appearance      =   0  'Flat
  412.             BackColor       =   &H80000002&
  413.             BorderStyle     =   0  'None
  414.             BeginProperty Font 
  415.                Name            =   "Courier"
  416.                Size            =   15
  417.                Charset         =   0
  418.                Weight          =   400
  419.                Underline       =   0   'False
  420.                Italic          =   0   'False
  421.                Strikethrough   =   0   'False
  422.             EndProperty
  423.             ForeColor       =   &H80000005&
  424.             Height          =   375
  425.             Left            =   1800
  426.             Locked          =   -1  'True
  427.             MaxLength       =   1
  428.             TabIndex        =   29
  429.             Top             =   1440
  430.             Width           =   975
  431.          End
  432.          Begin VB.Label Showtxt2 
  433.             BackColor       =   &H00800000&
  434.             BeginProperty Font 
  435.                Name            =   "Courier"
  436.                Size            =   15
  437.                Charset         =   0
  438.                Weight          =   400
  439.                Underline       =   0   'False
  440.                Italic          =   0   'False
  441.                Strikethrough   =   0   'False
  442.             EndProperty
  443.             ForeColor       =   &H8000000E&
  444.             Height          =   300
  445.             Left            =   1920
  446.             TabIndex        =   19
  447.             Top             =   600
  448.             Visible         =   0   'False
  449.             Width           =   1020
  450.          End
  451.       End
  452.       Begin VB.PictureBox HexDisplay 
  453.          AutoRedraw      =   -1  'True
  454.          BackColor       =   &H00FFFFFF&
  455.          BeginProperty Font 
  456.             Name            =   "Courier"
  457.             Size            =   15
  458.             Charset         =   0
  459.             Weight          =   400
  460.             Underline       =   0   'False
  461.             Italic          =   0   'False
  462.             Strikethrough   =   0   'False
  463.          EndProperty
  464.          Height          =   3045
  465.          Left            =   2040
  466.          ScaleHeight     =   2985
  467.          ScaleWidth      =   5235
  468.          TabIndex        =   9
  469.          Top             =   720
  470.          Width           =   5295
  471.          Begin VB.TextBox Edit 
  472.             Appearance      =   0  'Flat
  473.             BackColor       =   &H0000FFFF&
  474.             BorderStyle     =   0  'None
  475.             BeginProperty Font 
  476.                Name            =   "Courier"
  477.                Size            =   15
  478.                Charset         =   0
  479.                Weight          =   700
  480.                Underline       =   0   'False
  481.                Italic          =   0   'False
  482.                Strikethrough   =   0   'False
  483.             EndProperty
  484.             Height          =   285
  485.             Left            =   720
  486.             MaxLength       =   2
  487.             TabIndex        =   10
  488.             Top             =   960
  489.             Width           =   375
  490.          End
  491.       End
  492.       Begin VB.CommandButton VTop 
  493.          BackColor       =   &H00C0C0C0&
  494.          Enabled         =   0   'False
  495.          BeginProperty Font 
  496.             Name            =   "MS Sans Serif"
  497.             Size            =   8.25
  498.             Charset         =   0
  499.             Weight          =   400
  500.             Underline       =   0   'False
  501.             Italic          =   0   'False
  502.             Strikethrough   =   0   'False
  503.          EndProperty
  504.          Height          =   375
  505.          Left            =   7440
  506.          Picture         =   "Form1.frx":326E
  507.          Style           =   1  'Graphical
  508.          TabIndex        =   8
  509.          ToolTipText     =   "Goto top"
  510.          Top             =   720
  511.          Width           =   2055
  512.       End
  513.       Begin VB.CommandButton Up10 
  514.          BackColor       =   &H00C0C0C0&
  515.          Enabled         =   0   'False
  516.          BeginProperty Font 
  517.             Name            =   "MS Sans Serif"
  518.             Size            =   8.25
  519.             Charset         =   0
  520.             Weight          =   400
  521.             Underline       =   0   'False
  522.             Italic          =   0   'False
  523.             Strikethrough   =   0   'False
  524.          EndProperty
  525.          Height          =   375
  526.          Left            =   7440
  527.          Picture         =   "Form1.frx":3550
  528.          Style           =   1  'Graphical
  529.          TabIndex        =   7
  530.          ToolTipText     =   "Up 10 lines"
  531.          Top             =   1200
  532.          Width           =   2055
  533.       End
  534.       Begin VB.CommandButton Up1 
  535.          BackColor       =   &H00C0C0C0&
  536.          Enabled         =   0   'False
  537.          BeginProperty Font 
  538.             Name            =   "MS Sans Serif"
  539.             Size            =   8.25
  540.             Charset         =   0
  541.             Weight          =   400
  542.             Underline       =   0   'False
  543.             Italic          =   0   'False
  544.             Strikethrough   =   0   'False
  545.          EndProperty
  546.          Height          =   495
  547.          Left            =   7440
  548.          Picture         =   "Form1.frx":37C2
  549.          Style           =   1  'Graphical
  550.          TabIndex        =   6
  551.          ToolTipText     =   "Up 1 line"
  552.          Top             =   1680
  553.          Width           =   2055
  554.       End
  555.       Begin VB.CommandButton Down1 
  556.          BackColor       =   &H00C0C0C0&
  557.          Enabled         =   0   'False
  558.          BeginProperty Font 
  559.             Name            =   "MS Sans Serif"
  560.             Size            =   8.25
  561.             Charset         =   0
  562.             Weight          =   400
  563.             Underline       =   0   'False
  564.             Italic          =   0   'False
  565.             Strikethrough   =   0   'False
  566.          EndProperty
  567.          Height          =   495
  568.          Left            =   7440
  569.          Picture         =   "Form1.frx":3A34
  570.          Style           =   1  'Graphical
  571.          TabIndex        =   5
  572.          ToolTipText     =   "Down 1 line"
  573.          Top             =   2280
  574.          Width           =   2055
  575.       End
  576.       Begin VB.CommandButton Down10 
  577.          BackColor       =   &H00C0C0C0&
  578.          Enabled         =   0   'False
  579.          BeginProperty Font 
  580.             Name            =   "MS Sans Serif"
  581.             Size            =   8.25
  582.             Charset         =   0
  583.             Weight          =   400
  584.             Underline       =   0   'False
  585.             Italic          =   0   'False
  586.             Strikethrough   =   0   'False
  587.          EndProperty
  588.          Height          =   375
  589.          Left            =   7440
  590.          Picture         =   "Form1.frx":3CA6
  591.          Style           =   1  'Graphical
  592.          TabIndex        =   4
  593.          ToolTipText     =   "Down 10 lines"
  594.          Top             =   2880
  595.          Width           =   2055
  596.       End
  597.       Begin VB.CommandButton Bottom 
  598.          BackColor       =   &H00C0C0C0&
  599.          Enabled         =   0   'False
  600.          BeginProperty Font 
  601.             Name            =   "MS Sans Serif"
  602.             Size            =   8.25
  603.             Charset         =   0
  604.             Weight          =   400
  605.             Underline       =   0   'False
  606.             Italic          =   0   'False
  607.             Strikethrough   =   0   'False
  608.          EndProperty
  609.          Height          =   375
  610.          Left            =   7440
  611.          Picture         =   "Form1.frx":3F18
  612.          Style           =   1  'Graphical
  613.          TabIndex        =   3
  614.          ToolTipText     =   "Goto bottom"
  615.          Top             =   3360
  616.          Width           =   2055
  617.       End
  618.       Begin VB.PictureBox Position 
  619.          Appearance      =   0  'Flat
  620.          AutoRedraw      =   -1  'True
  621.          BackColor       =   &H00C0C0C0&
  622.          BeginProperty Font 
  623.             Name            =   "Courier"
  624.             Size            =   15
  625.             Charset         =   0
  626.             Weight          =   700
  627.             Underline       =   0   'False
  628.             Italic          =   0   'False
  629.             Strikethrough   =   0   'False
  630.          EndProperty
  631.          ForeColor       =   &H00000000&
  632.          Height          =   3060
  633.          Left            =   120
  634.          ScaleHeight     =   3030
  635.          ScaleWidth      =   1785
  636.          TabIndex        =   2
  637.          Top             =   720
  638.          Width           =   1815
  639.       End
  640.       Begin VB.PictureBox ColSet 
  641.          Appearance      =   0  'Flat
  642.          AutoRedraw      =   -1  'True
  643.          BackColor       =   &H00C0C0C0&
  644.          BeginProperty Font 
  645.             Name            =   "Times New Roman"
  646.             Size            =   15.75
  647.             Charset         =   0
  648.             Weight          =   700
  649.             Underline       =   0   'False
  650.             Italic          =   0   'False
  651.             Strikethrough   =   0   'False
  652.          EndProperty
  653.          ForeColor       =   &H00000000&
  654.          Height          =   375
  655.          Left            =   2040
  656.          ScaleHeight     =   345
  657.          ScaleWidth      =   5265
  658.          TabIndex        =   1
  659.          Top             =   240
  660.          Width           =   5295
  661.       End
  662.       Begin VB.Label ByteNo 
  663.          BorderStyle     =   1  'Fixed Single
  664.          BeginProperty Font 
  665.             Name            =   "Times New Roman"
  666.             Size            =   12
  667.             Charset         =   0
  668.             Weight          =   700
  669.             Underline       =   0   'False
  670.             Italic          =   0   'False
  671.             Strikethrough   =   0   'False
  672.          EndProperty
  673.          Height          =   375
  674.          Left            =   120
  675.          TabIndex        =   13
  676.          Top             =   240
  677.          Width           =   1815
  678.       End
  679.       Begin VB.Label Size 
  680.          Appearance      =   0  'Flat
  681.          BackColor       =   &H00C0C0C0&
  682.          BorderStyle     =   1  'Fixed Single
  683.          BeginProperty Font 
  684.             Name            =   "Times New Roman"
  685.             Size            =   12
  686.             Charset         =   0
  687.             Weight          =   400
  688.             Underline       =   0   'False
  689.             Italic          =   0   'False
  690.             Strikethrough   =   0   'False
  691.          EndProperty
  692.          ForeColor       =   &H80000008&
  693.          Height          =   375
  694.          Left            =   7440
  695.          TabIndex        =   11
  696.          Top             =   240
  697.          Width           =   2055
  698.       End
  699.    End
  700.    Begin VB.Menu filemnu 
  701.       Caption         =   "&File"
  702.       Begin VB.Menu openmnu 
  703.          Caption         =   "&Open"
  704.          Shortcut        =   ^O
  705.       End
  706.       Begin VB.Menu Saveme 
  707.          Caption         =   "Sa&ve"
  708.          Shortcut        =   ^Y
  709.       End
  710.       Begin VB.Menu savemnu 
  711.          Caption         =   "&Save As"
  712.          Shortcut        =   ^S
  713.       End
  714.       Begin VB.Menu closemnu 
  715.          Caption         =   "C&lose"
  716.          Shortcut        =   ^L
  717.       End
  718.       Begin VB.Menu a 
  719.          Caption         =   "-"
  720.       End
  721.       Begin VB.Menu exitmnu 
  722.          Caption         =   "E&xit"
  723.          Shortcut        =   ^Q
  724.       End
  725.    End
  726.    Begin VB.Menu editmnu 
  727.       Caption         =   "&Edit"
  728.       Begin VB.Menu editmodemnu 
  729.          Caption         =   "E&dit Mode"
  730.          Checked         =   -1  'True
  731.          Shortcut        =   ^D
  732.       End
  733.       Begin VB.Menu b 
  734.          Caption         =   "-"
  735.       End
  736.       Begin VB.Menu searchmnu 
  737.          Caption         =   "S&earch"
  738.          Shortcut        =   ^E
  739.       End
  740.       Begin VB.Menu bytemnu 
  741.          Caption         =   "&Goto byte"
  742.          Shortcut        =   ^G
  743.       End
  744.    End
  745.    Begin VB.Menu tools 
  746.       Caption         =   "&Tools"
  747.       Begin VB.Menu insertbytes 
  748.          Caption         =   "&Insert Byte"
  749.          Shortcut        =   ^I
  750.       End
  751.       Begin VB.Menu rembyte 
  752.          Caption         =   "&Remove Byte"
  753.          Shortcut        =   ^R
  754.       End
  755.       Begin VB.Menu addbyte 
  756.          Caption         =   "&Add Bytes"
  757.          Shortcut        =   ^A
  758.       End
  759.    End
  760.    Begin VB.Menu popup 
  761.       Caption         =   "popup"
  762.       Visible         =   0   'False
  763.       Begin VB.Menu edmode 
  764.          Caption         =   "E&dit Mode"
  765.          Checked         =   -1  'True
  766.       End
  767.       Begin VB.Menu c 
  768.          Caption         =   "-"
  769.       End
  770.       Begin VB.Menu insertb 
  771.          Caption         =   "&Insert Byte"
  772.       End
  773.       Begin VB.Menu removeb 
  774.          Caption         =   "&Remove Byte"
  775.       End
  776.       Begin VB.Menu addb 
  777.          Caption         =   "&Add Bytes"
  778.       End
  779.       Begin VB.Menu e 
  780.          Caption         =   "-"
  781.       End
  782.       Begin VB.Menu gos 
  783.          Caption         =   "S&earch"
  784.       End
  785.       Begin VB.Menu gob 
  786.          Caption         =   "&Goto byte"
  787.       End
  788.    End
  789. Attribute VB_Name = "Form1"
  790. Attribute VB_GlobalNameSpace = False
  791. Attribute VB_Creatable = False
  792. Attribute VB_PredeclaredId = True
  793. Attribute VB_Exposed = False
  794. Dim SetMode As Boolean, savemode As Boolean
  795. Private Sub addb_Click()
  796. AddBytes_Click
  797. End Sub
  798. Private Sub addbyte_Click()
  799. AddBytes_Click
  800. End Sub
  801. Private Sub AddBytes_Click()
  802. On Error Resume Next
  803. 'check they want to add bytes
  804. If MsgBox("Are you sure you want to add bytes to the end of the file?", vbYesNo) = vbNo Then Exit Sub
  805. Form4.Show 'show add bytes form
  806. End Sub
  807. Private Sub asciidisp_KeyUp(KeyCode As Integer, Shift As Integer)
  808. On Error Resume Next
  809. If asciidisp > 255 Then                      'check to see if ascii < 255
  810.     hexdisp.Text = ""                        'blank text
  811.     chardisp.Text = ""                       'blank text
  812.     binarytxt.Text = ""                      'blank text
  813.     hexdisp.Text = Hex(asciidisp.Text)       'Set hex text
  814.     chardisp.Text = Chr(asciidisp)           'set character text
  815.     binarytxt.Text = GetBinary(hexdisp.Text) 'set binary text
  816. End If
  817. End Sub
  818. Private Sub binarytxt_KeyPress(KeyAscii As Integer)
  819. If Chr(KeyAscii) <> vbBack Then                 'check for backspace key
  820.     If (KeyAscii >= 48 And KeyAscii <= 49) Then 'Make sure only numbers can be entered
  821.         DoEvents
  822.     Else
  823.         KeyAscii = 0
  824.     End If
  825. End If
  826. End Sub
  827. Private Sub binarytxt_KeyUp(KeyCode As Integer, Shift As Integer)
  828. Dim Length As Integer, counter As Integer, Total As Integer, No As Integer
  829. Length = Len(binarytxt.Text) 'set length of binary string
  830. No = 1
  831. Total = 0
  832. For counter = 0 To Length - 1
  833. If Mid(binarytxt.Text, Length - counter, 1) = 1 Then Total = Total + No 'add binary
  834. No = No * 2
  835. Next counter
  836. asciidisp.Text = Total       'update ascii
  837. chardisp.Text = Chr(Total)   'update character
  838. hexdisp.Text = Hex(Total)    'update hex
  839. End Sub
  840. Private Sub Bottom_Click()
  841. Dim EndBit As Integer, SetLen As String
  842. ByteNo.Caption = ""
  843. SetLen = SizeOfFile
  844. Edit.Visible = False
  845. Showtxt.Visible = False
  846. EndBit = Mid(SetLen, Len(SetLen), 1) 'get last row of hex
  847. CurrentPos = SizeOfFile - EndBit     'get start pos of last row
  848. SortHex                              'sort displayed hex
  849. End Sub
  850. Private Sub bytemnu_Click()
  851. If Fileopen = False Then Exit Sub    'Check if a file is open
  852. Form2.Show                           'show add form 2
  853. End Sub
  854. Private Sub chardisp_KeyUp(KeyCode As Integer, Shift As Integer)
  855. On Error Resume Next
  856. asciidisp.Text = Asc(chardisp.Text)      'update ascii
  857. hexdisp.Text = Hex(asciidisp.Text)       'update hex
  858. binarytxt.Text = GetBinary(hexdisp.Text) 'update binary
  859. End Sub
  860. Private Sub closemnu_Click()
  861. Dim counter As Integer
  862. If Fileopen = False Then Exit Sub
  863. If MsgBox("Are you sure you want to close this file?", vbYesNo) = vbYes Then 'check they want to close the file
  864. ReDim ByteArray(0) As Byte      'reset array
  865. For counter = 1 To 100
  866.     HexDisplayed(counter) = 100 'blank display array
  867. Next counter
  868. Attributes (False)              'call attributes function
  869. Me.Caption = "Hex Editor Pro"   'set my caption
  870. FileName = ""
  871. sizeofile = 0
  872. CurrentPos = 0
  873. DispTxt.Cls
  874. HexDisplay.Cls
  875. ByteNo.Caption = ""
  876. Size.Caption = ""
  877. End If
  878. End Sub
  879. Private Sub CmdInsert_Click()
  880. On Error Resume Next
  881. 'check byte is selected
  882. If Edit.Visible = False Then MsgBox "You must select a byte first", vbExclamation: Exit Sub
  883. If ByteNo.Caption = "" Then Exit Sub
  884. 'check they want to add a byte
  885. If MsgBox("Are you sure you want to add a byte here?", vbYesNo) = vbNo Then Exit Sub
  886. insertbyte (ByteNo.Caption) 'call insert byte function
  887. Edit.Text = "00"
  888. SortHex                     'sort displayed hex
  889. ByteNo = ""
  890. End Sub
  891. Private Sub cmdremove_Click()
  892. On Error Resume Next
  893. 'check byte is selected
  894. If Edit.Visible = False Then MsgBox "You must select a byte first", vbExclamation: Exit Sub
  895. If ByteNo.Caption = "" Then Exit Sub
  896. 'check they want to remove a byte
  897. If MsgBox("Are you sure you want to remove this byte?", vbYesNo) = vbNo Then Exit Sub
  898. RemoveByte (ByteNo.Caption) 'call remove byte function
  899. Edit.Visible = False
  900. Showtxt.Visible = False
  901. SortHex                     'sort displayed hex
  902. ByteNo = ""
  903. End Sub
  904. Private Sub DispTxt_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
  905. On Error Resume Next
  906. Dim Col, Row, No As Integer, HexSet As String, SAlpha As String, SetTemp As Integer
  907. If Button = 2 And Fileopen = True Then 'check right mouse button is pushed
  908. PopupMenu popup, , DispTxt.Left + X + 30, DispTxt.Top + Y + 380 'show popup menu
  909. Exit Sub
  910. End If
  911. Edit.Left = Int((X / HexDisplay.Width) * 10) * (HexDisplay.Width / 10)
  912. Edit.Top = Int((Y / HexDisplay.Height) * 10) * (HexDisplay.Height / 10)
  913. Showtxt.Left = Int((X / HexDisplay.Width) * 10) * (HexDisplay.Width / 10)
  914. Showtxt.Top = Int((Y / HexDisplay.Height) * 10) * (HexDisplay.Height / 10)
  915. Col = Int((X / HexDisplay.Width) * 10) + 1
  916. Row = Int((Y / HexDisplay.Height) * 10) + 1
  917. SetRow = Row
  918. SetCol = Col
  919. No = ((Row - 1) * 10) + Col 'set current pos
  920. SetTemp = HexDisplayed(No)  'get selected hex value
  921. If SetTemp = 0 Or SetTemp = 13 Or SetTemp = 10 Then 'check not return or enter
  922.     SAlpha = " "
  923.     SAlpha = Chr(SetTemp)
  924. End If
  925. Showtxt.Text = SAlpha    'show character
  926. If Fileopen = True Then
  927.     ByteNo.Caption = CurrentPos + (No - 1) 'show byte no
  928. End If
  929. HexSet = Hex(HexDisplayed(No)) 'get hex value
  930. If Len(HexSet) = 1 Then HexSet = "0" & HexSet 'make it 2 chars long
  931. Edit.Visible = True
  932. Showtxt.Visible = True
  933. If Fileopen = False Then Edit.Visible = False: Showtxt.Visible = False
  934. If HexSet <> "100" Then
  935. If Edit.Visible = True Then
  936. Edit.Text = HexSet
  937. hexdisp.Text = HexSet
  938. AscStore = HexToDec(HexSet)
  939. asciidisp.Text = AscStore                'update ascii
  940. chardisp.Text = Chr(AscStore)            'update character
  941. binarytxt.Text = GetBinary(HexSet)       'update binary
  942. End If
  943. Edit.Text = ""
  944. End If
  945. End Sub
  946. Private Sub Down1_Click()
  947. If CurrentPos > SizeOfFile - 10 Then Exit Sub 'make sure u can't go past end of file
  948. ByteNo.Caption = ""
  949. Edit.Visible = False
  950. Showtxt.Visible = False
  951. CurrentPos = CurrentPos + 10
  952. SortHex                                       'sort displayed hex
  953. End Sub
  954. Private Sub Down10_Click()
  955. If CurrentPos > SizeOfFile - 100 Then Exit Sub 'make sure u can't go past end of file
  956. ByteNo.Caption = ""
  957. Edit.Visible = False
  958. Showtxt.Visible = False
  959. CurrentPos = CurrentPos + 100
  960. SortHex                                        'sort displayed hex
  961. End Sub
  962. Private Sub Edit_KeyPress(KeyAscii As Integer)
  963. On Error Resume Next
  964. Dim Character As String
  965. If ByteNo.Caption > SizeOfFile Then Exit Sub  'Check not past end of file
  966. Character = Chr(KeyAscii)
  967. KeyAscii = Asc(UCase(Character))
  968. If Chr(KeyAscii) <> vbBack Then               'make sure only hex values can be entered
  969.     If (KeyAscii >= 48 And KeyAscii <= 57) Or (KeyAscii >= 65 And KeyAscii <= 70) Then
  970.         DoEvents                              '0-9 and a-f
  971.     Else
  972.         KeyAscii = 0
  973.     End If
  974. End If
  975. End Sub
  976. Private Sub Edit_KeyUp(KeyCode As Integer, Shift As Integer)
  977. On Error Resume Next
  978. If ByteNo.Caption > SizeOfFile Then Exit Sub           'Check not past end of file
  979. No = ((SetRow - 1) * 10) + SetCol                      'set position
  980. ByteArray((CurrentPos - 1) + No) = HexToDec(Edit.Text) 'update file
  981. HexDisplayed(No) = HexToDec(Edit.Text)                 'update hex displayed
  982. SortHex                                                'sort hex displayed
  983. Showtxt.Text = Chr(HexToDec(Edit.Text))                'update character text display
  984. If Edit.Locked = False Then savemode = True            'set save mode
  985. End Sub
  986. Private Sub editmodemnu_Click()
  987. Dim SetTemp As Integer, SAlpha As String
  988. ByteNo.Caption = ""
  989. Edit.Left = 0
  990. Edit.Top = 0
  991. If Selected = False Then
  992.     editmodemnu.Checked = True
  993.     edmode.Checked = True
  994.     Selected = True
  995.     Edit.BackColor = vbYellow
  996.     Showtxt.BackColor = vbYellow
  997.     Edit.ForeColor = vbBlack
  998.     Showtxt.ForeColor = vbBlack
  999.     Edit.Locked = False
  1000.     Showtxt.Locked = False
  1001.     Toolbar1.Buttons(5).Image = 3
  1002.     editmodemnu.Checked = False
  1003.     edmode.Checked = False
  1004.     Selected = False
  1005.     Edit.Locked = True
  1006.     Showtxt.Locked = True
  1007.     Edit.BackColor = &H800000
  1008.     Showtxt.BackColor = &H800000
  1009.     Edit.ForeColor = vbWhite
  1010.     Showtxt.ForeColor = vbWhite
  1011.     Toolbar1.Buttons(5).Image = 2
  1012. End If
  1013. Showtxt.Left = 0
  1014. Showtxt.Top = 0
  1015. Edit.Text = Hex(HexDisplayed(1)) 'get hex from array
  1016. SetTemp = HexDisplayed(1)
  1017. If SetTemp = 0 Or SetTemp = 13 Or SetTemp = 10 Then
  1018.     SAlpha = " "
  1019.     SAlpha = Chr(SetTemp)        'set alpha character for hex
  1020. End If
  1021. Showtxt.Text = SAlpha
  1022. ByteNo.Caption = 1
  1023. End Sub
  1024. Private Sub edmode_Click()
  1025.     editmodemnu_Click
  1026. End Sub
  1027. Private Sub exitmnu_Click()
  1028. Unload Me 'unload this form
  1029. End Sub
  1030. Private Sub Form_Load()
  1031. On Error Resume Next
  1032. CmdEdit.Caption = "Edit Mode"
  1033. Edit.Locked = True
  1034. Edit.BackColor = &H800000
  1035. Edit.ForeColor = vbWhite
  1036. editmodemnu.Checked = False
  1037. edmode.Checked = False
  1038. Edit.Width = HexDisplay.Width / 10
  1039. Edit.Height = HexDisplay.Height / 10
  1040. Showtxt.Width = HexDisplay.Width / 10
  1041. Showtxt.Height = HexDisplay.Height / 10
  1042. Attributes (False) 'call attributes function
  1043. ColSet.Print " 1     2     3     4     5     6     7     8     9    10"
  1044. End Sub
  1045. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
  1046. Dim Answer As Integer
  1047. If savemode = True Then
  1048.     Answer = MsgBox("Are you sure you want to exit without saving changes?", vbYesNoCancel)
  1049.     If Answer = vbCancel Then Cancel = 1
  1050.     If Answer = vbNo Then savemnu_Click: End
  1051. End If
  1052. End Sub
  1053. Private Sub gob_Click()
  1054. bytemnu_Click
  1055. End Sub
  1056. Private Sub gos_Click()
  1057. searchmnu_Click
  1058. End Sub
  1059. Private Sub hexdisp_KeyPress(KeyAscii As Integer)
  1060. Character = Chr(KeyAscii)
  1061. KeyAscii = Asc(UCase(Character)) 'convert ascii to uppercase
  1062. If Chr(KeyAscii) <> vbBack Then  'check for backspace key
  1063.     If (KeyAscii >= 48 And KeyAscii <= 57) Or (KeyAscii >= 65 And KeyAscii <= 70) Then
  1064.         DoEvents                 'make sure only hex values can be entered
  1065.     Else
  1066.         KeyAscii = 0
  1067.     End If
  1068. End If
  1069. End Sub
  1070. Private Sub hexdisp_KeyUp(KeyCode As Integer, Shift As Integer)
  1071. Dim AscStore As Integer
  1072. AscStore = HexToDec(hexdisp)
  1073. asciidisp.Text = AscStore                'update ascii
  1074. chardisp.Text = Chr(AscStore)            'update character
  1075. binarytxt.Text = GetBinary(hexdisp.Text) 'update binary
  1076. End Sub
  1077. Private Sub HexDisplay_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) ' complete
  1078. On Error Resume Next
  1079. Dim Col, Row, No As Integer, HexSet As String, SAlpha As String, SetTemp As Integer
  1080. Dim AscStore As Integer
  1081. If Button = 2 And Fileopen = True Then
  1082. PopupMenu popup, , HexDisplay.Left + X + 30, HexDisplay.Top + Y + 380 'show popup menu
  1083. Exit Sub
  1084. End If
  1085. Edit.Left = Int((X / HexDisplay.Width) * 10) * (HexDisplay.Width / 10)
  1086. Edit.Top = Int((Y / HexDisplay.Height) * 10) * (HexDisplay.Height / 10)
  1087. Showtxt.Left = Int((X / HexDisplay.Width) * 10) * (HexDisplay.Width / 10)
  1088. Showtxt.Top = Int((Y / HexDisplay.Height) * 10) * (HexDisplay.Height / 10)
  1089. Col = Int((X / HexDisplay.Width) * 10) + 1
  1090. Row = Int((Y / HexDisplay.Height) * 10) + 1
  1091. SetRow = Row
  1092. SetCol = Col
  1093. No = ((Row - 1) * 10) + Col 'get position
  1094. SetTemp = HexDisplayed(No)  'get hex value
  1095. If SetTemp = 0 Or SetTemp = 13 Or SetTemp = 10 Then
  1096.     SAlpha = " "
  1097.     SAlpha = Chr(SetTemp)   'convert to character
  1098. End If
  1099. Showtxt.Text = SAlpha    'display alpha
  1100. If Fileopen = True Then
  1101.     ByteNo.Caption = CurrentPos + (No - 1) 'show byte number
  1102. End If
  1103. HexSet = Hex(HexDisplayed(No))             'get hex value
  1104. If Len(HexSet) = 1 Then HexSet = "0" & HexSet
  1105. Edit.Visible = True
  1106. Showtxt.Visible = True
  1107. If Fileopen = False Then Edit.Visible = False: Showtxt.Visible = False
  1108. If HexSet <> "100" Then
  1109. If Edit.Visible = True Then
  1110. Edit.Text = HexSet
  1111. hexdisp.Text = HexSet
  1112. AscStore = HexToDec(HexSet)
  1113. asciidisp.Text = AscStore                'update ascii
  1114. chardisp.Text = Chr(AscStore)            'update character
  1115. binarytxt.Text = GetBinary(HexSet)       'update binary
  1116. End If
  1117. Edit.Text = ""
  1118. End If
  1119. End Sub
  1120. Function OpenFile()
  1121. On Error Resume Next
  1122. Dim Fno As Integer
  1123. Fno = FreeFile                               'get free file number
  1124. savemode = False                             'Set save mode as false
  1125. Open FileName For Binary As #Fno             'open file
  1126.     SizeOfFile = LOF(Fno)                    'get size of file
  1127.     ReDim ByteArray(1 To SizeOfFile) As Byte 'reset byte array to size of file
  1128.     Get #Fno, , ByteArray                    'load bytes into array
  1129. Close #Fno
  1130. CurrentPos = 1
  1131. StartByte = 0
  1132. Attributes (True)
  1133. Size.Caption = " " & SizeOfFile & " bytes"
  1134. Me.Caption = "Hex Editor Pro - " & FileName
  1135. Call SortHex                                 'sort hex displayed
  1136. End Function
  1137. Function SortHex()
  1138. On Error Resume Next
  1139. Dim counter As Integer, Counter2 As Integer, HexSet As String
  1140. Dim Line1 As String, Lines(1 To 10) As String, SAlpha As String, SetTemp As Integer
  1141. Static Pos As Integer
  1142. For counter = 1 To 100
  1143.     If ((CurrentPos - 1) + counter) > SizeOfFile Then
  1144.         HexDisplayed(counter) = 256
  1145.     Else
  1146.         HexDisplayed(counter) = ByteArray((CurrentPos - 1) + counter) 'Fill byte array
  1147.     End If
  1148. Next counter
  1149. For counter = 1 To 10
  1150.     Pos = (counter - 1) * 10
  1151.     For Counter2 = 1 To 10
  1152.         Pos = Pos + 1
  1153.         HexSet = Hex(HexDisplayed(Pos))
  1154.         If Len(HexSet) = 1 Then HexSet = "0" & HexSet 'make 2 chars long
  1155.         If HexSet <> "100" Then Lines(counter) = Lines(counter) & HexSet & " " 'get display
  1156.     Next Counter2
  1157. Next counter
  1158. HexDisplay.Cls
  1159. For counter = 1 To 10
  1160.     HexDisplay.Print Lines(counter) 'print hex
  1161. Next counter
  1162. DispTxt.Cls
  1163. For counter = 1 To 10
  1164. Line1 = ""
  1165.     For Counter2 = 1 To 10
  1166.         SetTemp = HexDisplayed(((counter - 1) * 10) + Counter2) 'get hex value from array
  1167.         If SetTemp < 256 Then
  1168.             If SetTemp = 0 Or SetTemp = 13 Or SetTemp = 10 Then
  1169.                 SAlpha = " "
  1170.             Else
  1171.                 SAlpha = Chr(SetTemp) 'set characters for hex values
  1172.             End If
  1173.         Else
  1174.             SAlpha = ""
  1175.         End If
  1176.         Line1 = Line1 & "  " & SAlpha 'update chars
  1177.     Next Counter2
  1178.     Line1 = Mid(Line1, 3, Len(Line1) - 2)
  1179. DispTxt.Print Line1 'print line of chars
  1180. Next counter
  1181. Position.Cls
  1182. For counter = 1 To 10
  1183.     Position.Print (((counter - 1) * 10) + (CurrentPos) - 1) 'print bytes position
  1184. Next counter
  1185. End Function
  1186. Private Sub insertb_Click()
  1187. CmdInsert_Click
  1188. End Sub
  1189. Private Sub insertbytes_Click()
  1190. CmdInsert_Click
  1191. End Sub
  1192. Private Sub openmnu_Click()
  1193. On Error Resume Next
  1194. Dim File As String, counter As Integer, No As Integer
  1195. Edit.Visible = False
  1196. Showtxt.Visible = False
  1197. File = CommonDialog.ShowOpenDlg(Me.hwnd, "All files (*.*)" & Chr(0) & "*.*") 'show open dialog
  1198. If File <> "Cancel" Then
  1199.     FileName = File
  1200.     Exit Sub
  1201. End If
  1202. For counter = 0 To 5
  1203. If Mid(File, Len(File) - counter, 1) = "." Then No = counter: GoTo NextStep 'find "."
  1204. Next counter
  1205. NextStep:
  1206. EXTENSION = Mid(File, Len(File) - No + 1, No - 1) 'store extension
  1207. OpenFile 'call openfile function
  1208. End Sub
  1209. Private Sub rembyte_Click()
  1210. cmdremove_Click
  1211. End Sub
  1212. Private Sub removeb_Click()
  1213. cmdremove_Click
  1214. End Sub
  1215. Private Sub Saveme_Click()
  1216. Dim Fno As Integer
  1217. If Fileopen = False Then Exit Sub
  1218. If MsgBox("Are you sure you want to save the changes?", vbYesNo) = vbYes Then 'check they want to save
  1219. Fno = FreeFile 'get free file number
  1220. Open FileName For Binary As #Fno
  1221. Put #Fno, , ByteArray 'put array into file
  1222. Close #Fno
  1223. savemode = False
  1224. End If
  1225. End Sub
  1226. Private Sub savemnu_Click()
  1227. On Error Resume Next
  1228. Dim Fno As Integer, File As String, SetType As String, Temp As String
  1229. If Fileopen = False Then Exit Sub
  1230. Fno = FreeFile 'get free file number
  1231. SetType = UCase(EXTENSION) & " files (*." & LCase(EXTENSION) & ")" & Chr(0) & "*." & EXTENSION
  1232. File = CommonDialog.ShowSavedlg(Me.hwnd, SetType, "Save As")
  1233. If File <> "Cancel" Then
  1234.     DoEvents
  1235.     Exit Sub
  1236. End If
  1237. File = Mid(File, 1, Len(File) - 1)
  1238. EXTENSION = LCase(EXTENSION)
  1239. File = LCase(File)
  1240. Temp = Mid(File, Len(File) - 2, 3)
  1241. If Temp = EXTENSION Then
  1242. DoEvents
  1243. File = File & "." & EXTENSION
  1244. End If
  1245. Open File For Binary As #Fno
  1246. Put #Fno, , ByteArray 'put array into file
  1247. Close #Fno
  1248. savemode = False
  1249. FileName = File
  1250. End Sub
  1251. Private Sub searchmnu_Click()
  1252. If Fileopen = False Then Exit Sub
  1253. Form3.Show
  1254. End Sub
  1255. Private Sub textDisplay_DblClick()
  1256. MsgBox Len(textDisplay.Text)
  1257. End Sub
  1258. Private Sub Showtxt_KeyPress(KeyAscii As Integer)
  1259. On Error Resume Next
  1260. Edit.Text = Hex(KeyAscii)
  1261. End Sub
  1262. Private Sub Showtxt_KeyUp(KeyCode As Integer, Shift As Integer)
  1263. On Error Resume Next
  1264. If ByteNo.Caption > SizeOfFile Then Exit Sub           'Check not past end of file
  1265. No = ((SetRow - 1) * 10) + SetCol                      'set position
  1266. ByteArray((CurrentPos - 1) + No) = HexToDec(Edit.Text) 'update file
  1267. HexDisplayed(No) = HexToDec(Edit.Text)                 'update hex displayed
  1268. SortHex                                                'sort hex displayed
  1269. End Sub
  1270. Private Sub Toolbar1_ButtonClick(ByVal Button As MSComctlLib.Button)
  1271. On Error Resume Next
  1272. If Button.Key = "open" Then openmnu_Click
  1273. If Button.Key = "save" Then savemnu_Click
  1274. If Button.Key = "close" Then closemnu_Click
  1275. If Fileopen = True Then
  1276.     If Button.Key = "Remove" Then cmdremove_Click
  1277.     If Button.Key = "Add" Then AddBytes_Click
  1278.     If Button.Key = "Insert" Then CmdInsert_Click
  1279.     If Button.Key = "search" Then searchmnu_Click
  1280.     If Button.Key = "goto" Then bytemnu_Click
  1281.     If Button.Key = "Edit" Then editmodemnu_Click
  1282. End If
  1283. End Sub
  1284. Private Sub vTop_Click()
  1285. ByteNo.Caption = ""
  1286. CurrentPos = 1
  1287. Edit.Visible = False
  1288. Showtxt.Visible = False
  1289. SortHex 'sort hex displayed
  1290. End Sub
  1291. Private Sub Up1_Click()
  1292. If CurrentPos - 10 < 1 Then vTop_Click: Exit Sub 'make sure can't go above top of file
  1293. ByteNo.Caption = ""
  1294. Edit.Visible = False
  1295. Showtxt.Visible = False
  1296. CurrentPos = CurrentPos - 10
  1297. SortHex
  1298. End Sub
  1299. Private Sub Up10_Click()
  1300. If CurrentPos - 100 < 1 Then vTop_Click: Exit Sub 'make sure can't go above top of file
  1301. ByteNo.Caption = ""
  1302. Edit.Visible = False
  1303. Showtxt.Visible = False
  1304. CurrentPos = CurrentPos - 100
  1305. SortHex
  1306. End Sub
  1307. Function HexSearch(HexVal As String, StartVal As Long) As Long
  1308. Dim ASCIIVal As Integer, counter As Long
  1309. ASCIIVal = HexToDec(HexVal)
  1310. For counter = StartVal To SizeOfFile 'search until hex value is found
  1311. If ByteArray(counter) = ASCIIVal Then HexSearch = counter: Exit Function Else HexSearch = -1
  1312. Next counter
  1313. End Function
  1314. Function SearchChars(SearchString As String, StartVal As Long) As Long
  1315. Dim counter As Long, StrArr() As Integer, Counter2 As Integer, Check As Boolean
  1316. ReDim StrArr(1 To Len(SearchString)) As Integer 'resize to length of string
  1317. Check = True
  1318. For counter = 1 To Len(SearchString)
  1319. StrArr(counter) = Asc(Mid(SearchString, counter, 1)) 'split string into characters
  1320. Next counter
  1321. For counter = StartVal To SizeOfFile
  1322. If ByteArray(counter) = StrArr(1) Then 'if first characters match
  1323.     If Len(SearchString) > 1 Then
  1324.         For Counter2 = 2 To Len(SearchString) 'check other characters match
  1325.             If ByteArray(counter + (Counter2 - 1)) <> StrArr(Counter2) Then
  1326.                 Check = False
  1327.             End If
  1328.         Next Counter2
  1329.         If Check = True Then SearchChars = counter: Exit Function 'if found state position
  1330.     Else
  1331.         SearchChars = counter
  1332.         Exit Function
  1333.     End If
  1334. End If
  1335. Next counter
  1336. SearchChars = -1
  1337. End Function
  1338. Function GetBinary(ByVal inHex As String) As String
  1339.     Dim mDec As Integer
  1340.     Dim s As String
  1341.     Dim i
  1342.     mDec = CInt("&h" & inHex)
  1343.     s = Trim(CStr(mDec Mod 2))
  1344.     i = mDec \ 2
  1345.     Do While i <> 0
  1346.         s = Trim(CStr(i Mod 2)) & s
  1347.         i = i \ 2
  1348.     Loop
  1349.     Do While Len(s) < 8
  1350.         s = "0" & s
  1351.     Loop
  1352.     GetBinary = s
  1353. End Function
  1354. Function Attributes(Value As Boolean)
  1355. Fileopen = Value
  1356. Down1.Enabled = Value
  1357. Down10.Enabled = Value
  1358. Bottom.Enabled = Value
  1359. Up1.Enabled = Value
  1360. Up10.Enabled = Value
  1361. VTop.Enabled = Value
  1362. CmdInsert.Enabled = Value
  1363. insertbytes.Enabled = Value
  1364. rembyte.Enabled = Value
  1365. addbyte.Enabled = Value
  1366. AddBytes.Enabled = Value
  1367. SearchChar = Value
  1368. cmdremove.Enabled = Value
  1369. If Value = False Then Edit.Visible = False: Showtxt.Visible = False
  1370. End Function
  1371.